package com.preferences;

import android.os.Bundle;
import android.preference.Preference;
import android.preference.Preference.OnPreferenceClickListener;
import android.preference.PreferenceActivity;
import android.widget.Toast;

import com.activities.R;

public class MainPreference extends PreferenceActivity {

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		addPreferencesFromResource(R.xml.preferences);
		
		Preference fileChooser = (Preference) findPreference(getString(R.string.main_pref_button));
		fileChooser.setOnPreferenceClickListener(new OnPreferenceClickListener() {
			
			@Override
			public boolean onPreferenceClick(Preference arg0) {
				// TODO Auto-generated method stub
				Toast.makeText(getBaseContext(), "Clicked preference button", Toast.LENGTH_SHORT).show();
				return true;
			}
		});
	}
}
